home *** CD-ROM | disk | FTP | other *** search
- ;/* PC/FTP Packet Driver source, conforming to version 1.05 of the spec
- ;* Russell Nelson, Clarkson University. July 20, 1988
- ;* Portions (C) Copyright 1988 Russell Nelson
- ;*
- ;* Permission is granted to any individual or institution to use, copy,
- ;* modify, or redistribute this software and its documentation provided
- ;* this notice and the copyright notices are retained. This software may
- ;* not be distributed for profit, either in original form or in derivative
- ;* works. Russell Nelson makes no representations about the suitability
- ;* of this software for any purpose. RUSSELL NELSON GIVES NO WARRANTY,
- ;* EITHER EXPRESS OR IMPLIED, FOR THE PROGRAM AND/OR DOCUMENTATION
- ;* PROVIDED, INCLUDING, WITHOUT LIMITATION, WARRANTY OF MERCHANTABILITY
- ;* AND WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE.
- ;*/
-
- .286
-
- HT equ 09h
- CR equ 0dh
- LF equ 0ah
-
- ;
- ; Packet Driver Error numbers
- BAD_HANDLE equ 1 ;invalid handle number
- NO_CLASS equ 2 ;no interfaces of specified class found
- NO_TYPE equ 3 ;no interfaces of specified type found
- NO_NUMBER equ 4 ;no interfaces of specified number found
- BAD_TYPE equ 5 ;bad packet type specified
- NO_MULTICAST equ 6 ;this interface does not support
- CANT_TERMINATE equ 7 ;this packet driver cannot terminate
- BAD_MODE equ 8 ;an invalid receiver mode was specified
- NO_SPACE equ 9 ;operation failed because of insufficient
- TYPE_INUSE equ 10 ;the type had previously been accessed,
- BAD_COMMAND equ 11 ;the command was out of range, or not
- CANT_SEND equ 12 ;the packet couldn't be sent (usually
-
-
- RUNT equ 60 ;smallest legal size packet, no fcs
- GIANT equ 1514 ;largest legal size packet, no fcs
-
- EADDR_LEN equ 6 ;Ethernet address length.
-
- ;The following two macros are used to manipulate port addresses.
- ;Use loadport to initialize dx. Use setport to set a specific port on
- ;the board. setport remembers what the current port number is, but beware!
- ;setport assumes that code is being executed in the same order as the
- ;code is presented in the source file. Whenever this assumption is violated,
- ;you need to enter another loadport.
- loadport macro
- mov dx,io_addr
- port_no = 0
- endm
-
- ;change the port number from the current value to the new value.
- setport macro new_port_no
- ifdef no_confidence ;define if you suspect that you don't
- loadport ; have enough loadports, i.e. dx is
- endif ; set to the wrong port.
- if new_port_no - port_no EQ 1
- inc dx
- else
- if new_port_no - port_no EQ -1
- dec dx
- else
- if new_port_no - port_no NE 0
- add dx,new_port_no - port_no
- endif
- endif
- endif
- port_no = new_port_no
- endm
-